CBL-8390: Support comparing and continuing from a non-numeric checkpoint#2499
Merged
Conversation
Also updated tools module to release/3.4
|
This is a release branch and commits are restricted. Please confirm this PR is one of the following:
|
|
Code Coverage Results:
|
There was a problem hiding this comment.
Pull request overview
This PR updates the replicator checkpoint reconciliation logic to support Sync Gateway-style compound (non-numeric) sequence IDs, so LiteCore can compare remote checkpoint values instead of always resetting when they aren’t plain integers.
Changes:
- Added
ParsedSequenceIDto parse/compare SG compound sequence formats (simple, backfill, lowSeq). - Enhanced
RemoteSequenceandCheckpoint::validateWithto compare parseable compound checkpoints and only reset when sequences are truly unparseable. - Added comprehensive unit tests for parsing/comparison rules and integrated them into CMake and Xcode project targets.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Xcode/LiteCore.xcodeproj/project.pbxproj | Adds new replicator header and test source to Xcode project/test targets. |
| Replicator/tests/ParsedSequenceIDTest.cc | New tests covering parsing and ordering (including quoted JSON-string cases). |
| Replicator/RemoteSequence.hh | Adds conversion helper to parse/normalize remote sequences into ParsedSequenceID. |
| Replicator/ParsedSequenceID.hh | New parsing + ordering implementation for compound SG sequence IDs. |
| Replicator/Checkpoint.cc | Uses parsed ordering to decide rollback/ignore behavior for mismatched remote sequences. |
| LiteCore/tests/CMakeLists.txt | Includes the new test file in the CMake-based test target. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+262
to
+265
| // Rule: simple.seq < backfill.triggeredBy (strict <) | ||
| // A plain seq N sorts BEFORE a backfill triggered at N, | ||
| // meaning "N" < "N:M" for any M. | ||
|
|
pasin
approved these changes
Jun 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Also updated tools module to release/3.4